{% extends 'base.html' %}
{% block title %}代办事项程序{% endblock %}

{% block content %}
<div id="todo-add">
  <form action="{{ url_for('add') }}" method="post">
    <textarea placeholder="请输入代办事项" name="content" cols=50 rows=5></textarea>
    <button type="submit">添加</button>
  </form>

</div>

<hr>

<div id="todo-list">
  <table style="border: 1px solid black;">
    <th>
      <td>状态</td>
      <td>内容</td>
      <td>删除</td>
      <td>完成</td>
    </th>
    {% for todo in todo_list %}
      <tr>
        {% if todo.status == 0 %}
          <td>未完成</td>
        {% elif todo.status == 1 %}
          <td>已完成</td>
        {% endif %}
{#        <td>{{ todo.status }}</td>#}
        <td>{{ todo.content }}</td>
        <td><a href="{{ url_for('delete',content=todo.content) }}">删除</a></td>
        <td><a href="#">完成</a></td>
{#        {{ todo._id }}#}
      </tr>
    {% endfor %}
  </table>
</div>
{% endblock %}

